#include "gtkscrollable.h"
#include "gtkadjustment.h"
#include "gtkpopover.h"
+#include "gtkrevealer.h"
#include <cairo-gobject.h>
#include <errno.h>
/* The file browsing widgets */
GtkWidget *browse_widgets_box;
GtkWidget *browse_widgets_hpaned;
+ GtkWidget *browse_header_revealer;
GtkWidget *browse_header_box;
GtkWidget *browse_header_stack;
GtkWidget *browse_files_box;
priv->operation_mode == OPERATION_MODE_RECENT)
return;
- /* Box */
-
- gtk_widget_show (priv->browse_header_box);
-
- /* Entry */
+ gtk_revealer_set_reveal_child (GTK_REVEALER (priv->browse_header_revealer), TRUE);
if (!priv->location_entry)
{
gtk_box_pack_start (GTK_BOX (priv->location_entry_box), priv->location_entry, TRUE, TRUE, 0);
}
- /* Configure the entry */
-
_gtk_file_chooser_entry_set_base_folder (GTK_FILE_CHOOSER_ENTRY (priv->location_entry), priv->current_folder);
- /* Done */
-
gtk_widget_show (priv->location_entry);
gtk_stack_set_visible_child_name (GTK_STACK (priv->browse_header_stack), "location");
return;
}
- gtk_widget_set_visible (priv->browse_header_box, visible);
-
if (visible)
{
if (priv->create_folders
gtk_stack_set_visible_child_name (GTK_STACK (priv->browse_files_stack), "list");
gtk_stack_set_visible_child_name (GTK_STACK (priv->browse_header_stack), "location");
+ gtk_revealer_set_reveal_child (GTK_REVEALER (priv->browse_header_revealer), TRUE);
location_bar_update (impl);
gtk_widget_set_sensitive (priv->filter_combo, TRUE);
location_mode_set (impl, LOCATION_MODE_FILENAME_ENTRY);
gtk_stack_set_visible_child_name (GTK_STACK (priv->browse_files_stack), "list");
gtk_stack_set_visible_child_name (GTK_STACK (priv->browse_header_stack), "pathbar");
+ gtk_revealer_set_reveal_child (GTK_REVEALER (priv->browse_header_revealer), TRUE);
location_bar_update (impl);
gtk_widget_set_sensitive (priv->filter_combo, TRUE);
gtk_tree_view_column_set_visible (priv->list_location_column, FALSE);
gtk_stack_set_visible_child_name (GTK_STACK (priv->browse_files_stack), "list");
gtk_stack_set_visible_child_name (GTK_STACK (priv->browse_header_stack), "search");
+ gtk_revealer_set_reveal_child (GTK_REVEALER (priv->browse_header_revealer), TRUE);
location_bar_update (impl);
search_setup_widgets (impl);
gtk_entry_grab_focus_without_selecting (GTK_ENTRY (priv->search_entry));
gtk_stack_set_visible_child_name (GTK_STACK (priv->browse_files_stack), "list");
gtk_stack_set_visible_child_name (GTK_STACK (priv->browse_header_stack), "pathbar");
+ gtk_revealer_set_reveal_child (GTK_REVEALER (priv->browse_header_revealer), FALSE);
location_bar_update (impl);
recent_start_loading (impl);
file = g_file_new_for_uri ("recent:///");
gtk_widget_class_bind_template_child_private (widget_class, GtkFileChooserWidget, browse_widgets_box);
gtk_widget_class_bind_template_child_private (widget_class, GtkFileChooserWidget, places_sidebar);
gtk_widget_class_bind_template_child_private (widget_class, GtkFileChooserWidget, browse_files_tree_view);
+ gtk_widget_class_bind_template_child_private (widget_class, GtkFileChooserWidget, browse_header_revealer);
gtk_widget_class_bind_template_child_private (widget_class, GtkFileChooserWidget, browse_header_box);
gtk_widget_class_bind_template_child_private (widget_class, GtkFileChooserWidget, browse_header_stack);
gtk_widget_class_bind_template_child_private (widget_class, GtkFileChooserWidget, browse_new_folder_button);
<property name="hscrollbar_policy">never</property>
<property name="local_only">True</property>
<property name="show_enter_location">True</property>
- <property name="show_recent">True</property>
<style>
<class name="sidebar"/>
</style>
<property name="visible">True</property>
<property name="orientation">vertical</property>
<child>
- <object class="GtkBox" id="browse_header_box">
- <property name="orientation">vertical</property>
- <property name="spacing">12</property>
- <style>
- <class name="search-bar"/>
- </style>
+ <object class="GtkRevealer" id="browse_header_revealer">
+ <property name="visible">True</property>
+ <property name="hexpand">True</property>
<child>
- <object class="GtkStack" id="browse_header_stack">
+ <object class="GtkBox" id="browse_header_box">
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="transition-type">crossfade</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">12</property>
+ <style>
+ <class name="search-bar"/>
+ </style>
<child>
- <object class="GtkBox" id="browse_path_bar_hbox">
+ <object class="GtkStack" id="browse_header_stack">
<property name="visible">True</property>
- <property name="spacing">6</property>
- <property name="border_width">6</property>
+ <property name="can_focus">True</property>
+ <property name="transition-type">crossfade</property>
<child>
- <object class="GtkPathBar" id="browse_path_bar">
+ <object class="GtkBox" id="browse_path_bar_hbox">
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <signal name="path-clicked" handler="path_bar_clicked" after="yes" swapped="no"/>
+ <property name="spacing">6</property>
+ <property name="border_width">6</property>
+ <child>
+ <object class="GtkPathBar" id="browse_path_bar">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <signal name="path-clicked" handler="path_bar_clicked" after="yes" swapped="no"/>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkMenuButton" id="browse_new_folder_button">
+ <property name="label" translatable="yes">Create _Folder</property>
+ <property name="can_focus">True</property>
+ <property name="use_underline">True</property>
+ <property name="popover">new_folder_popover</property>
+ <signal name="notify::active" handler="new_folder_popover_active"/>
+ </object>
+ <packing>
+ <property name="fill">False</property>
+ <property name="pack_type">end</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
</object>
<packing>
- <property name="expand">True</property>
+ <property name="name">pathbar</property>
</packing>
</child>
<child>
- <object class="GtkMenuButton" id="browse_new_folder_button">
- <property name="label" translatable="yes">Create _Folder</property>
- <property name="can_focus">True</property>
- <property name="use_underline">True</property>
- <property name="popover">new_folder_popover</property>
- <signal name="notify::active" handler="new_folder_popover_active"/>
+ <object class="GtkBox" id="location_entry_box">
+ <property name="visible">True</property>
+ <property name="no-show-all">True</property>
+ <property name="spacing">6</property>
+ <property name="border_width">6</property>
</object>
<packing>
- <property name="fill">False</property>
- <property name="pack_type">end</property>
- <property name="position">1</property>
+ <property name="name">location</property>
</packing>
</child>
- </object>
- <packing>
- <property name="name">pathbar</property>
- </packing>
- </child>
- <child>
- <object class="GtkBox" id="location_entry_box">
- <property name="visible">True</property>
- <property name="no-show-all">True</property>
- <property name="spacing">6</property>
- <property name="border_width">6</property>
- </object>
- <packing>
- <property name="name">location</property>
- </packing>
- </child>
- <child>
- <object class="GtkBox" id="search_entry_box">
- <property name="visible">True</property>
- <property name="no-show-all">True</property>
- <property name="spacing">6</property>
- <property name="border_width">6</property>
- <child>
- <object class="GtkSearchEntry" id="search_entry">
- <property name="visible">True</property>
- <property name="hexpand">True</property>
- <signal name="search-changed" handler="search_entry_activate_cb" swapped="yes"/>
- <signal name="stop-search" handler="search_entry_stop_cb" swapped="yes"/>
- </object>
- </child>
<child>
- <object class="GtkBox">
+ <object class="GtkBox" id="search_entry_box">
<property name="visible">True</property>
- <style>
- <class name="linked"/>
- </style>
+ <property name="no-show-all">True</property>
+ <property name="spacing">6</property>
+ <property name="border_width">6</property>
<child>
- <object class="GtkRadioButton" id="current_location_radio">
+ <object class="GtkSearchEntry" id="search_entry">
<property name="visible">True</property>
- <property name="draw-indicator">False</property>
- <property name="label" translatable="yes">Home</property>
- <signal name="toggled" handler="search_entry_activate_cb" swapped="yes"/>
+ <property name="hexpand">True</property>
+ <signal name="search-changed" handler="search_entry_activate_cb" swapped="yes"/>
+ <signal name="stop-search" handler="search_entry_stop_cb" swapped="yes"/>
</object>
</child>
<child>
- <object class="GtkRadioButton">
+ <object class="GtkBox">
<property name="visible">True</property>
- <property name="draw-indicator">False</property>
- <property name="group">current_location_radio</property>
- <property name="label" translatable="yes">All Files</property>
+ <style>
+ <class name="linked"/>
+ </style>
+ <child>
+ <object class="GtkRadioButton" id="current_location_radio">
+ <property name="visible">True</property>
+ <property name="draw-indicator">False</property>
+ <property name="label" translatable="yes">Home</property>
+ <signal name="toggled" handler="search_entry_activate_cb" swapped="yes"/>
+ </object>
+ </child>
+ <child>
+ <object class="GtkRadioButton">
+ <property name="visible">True</property>
+ <property name="draw-indicator">False</property>
+ <property name="group">current_location_radio</property>
+ <property name="label" translatable="yes">All Files</property>
+ </object>
+ </child>
</object>
</child>
</object>
+ <packing>
+ <property name="name">search</property>
+ </packing>
</child>
</object>
<packing>
- <property name="name">search</property>
+ <property name="fill">False</property>
</packing>
</child>
</object>
- <packing>
- <property name="fill">False</property>
- </packing>
</child>
</object>
<packing>